home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************/
- /* MainGetProc */
- /************************************************************************************/
-
- #include "MyHeaders.h"
-
- short MainGetProc ()
- {
- short MGRetCode = 0;
-
- Rect mainRect;
- short rectHeight, rectWidth;
- short newH, newV;
- short itemHit; /* return from modal dialog */
-
- windSub = 0; /* point to main info */
-
- if (useColor)
- windTbl[windSub].windPtr = /* get the color template */
- GetNewCWindow (128, &windTbl[windSub].windRec, (WindowPtr) -1);
- else
- windTbl[windSub].windPtr = /* get the template */
- GetNewWindow (128, &windTbl[windSub].windRec, (WindowPtr) -1);
-
- windTbl[windSub].windRec.refCon = ProcMain; /* save window type */
-
- mainRect = (*windTbl[windSub].windPtr).portRect; /* position wdow on desktop */
- rectHeight = mainRect.bottom - mainRect.top;
- rectWidth = mainRect.right - mainRect.left;
- newH = (screenBits.bounds.right - rectWidth) * .50; /* centered horizonally */
- if (newH < 10) /* (not less than 10) */
- newH = 10;
- newV = ((screenBits.bounds.bottom /* vertical position */
- - rectHeight - 20) * .50) + 20; /* one-half down */
- if (newV < 40) /* (not less than 40) */
- newV = 40;
- MoveWindow (windTbl[windSub].windPtr, newH, newV, TRUE); /* move into posit. */
-
- SetPort (windTbl[windSub].windPtr); /* set as the grafPort */
-
- TextFont(geneva); /* choose the font... */
- TextFace(NIL); /* ... style, and.. */
- TextSize(10); /* ... size */
-
- ShowWindow (windTbl[windSub].windPtr);
-
- InvalRect (&(*windTbl[windSub].windPtr).portRect); /* indicate need for update */
-
- return MGRetCode;
- }
-